package com.cosyhut.blocks.engine;

import com.cosyhut.blocks.display.*;
import com.cosyhut.blocks.factory.*;
import com.cosyhut.blocks.jode.*;

import com.jme.math.*;
//import com.jme.util.*;
//import java.util.logging.Level;


/**
 * 
 * @author TimWorks
 * Jan 27, 2006
 * 
 * simple robot, temporary class
 *
 */
public class BRobotSimple extends BRobot {

	public BRobotSimple(String name, Engine e, GRenderer r) {
		super(name, e, r);
	}
	protected void create() {
		BFactory f = BFactory.get();
		
		// create blocks
		Block block1 = f.createBlock("Block_T");
		block1.setPosition(new Vector3f(0f, 0f, 0f));
		this.addBlock( block1);

		Block block2 = f.createBlock("Block_T");
		
		block2.setPosition(new Vector3f(-0.5f, 0f, 0f));
		Matrix3f rotation2 = new Matrix3f();
		//rotation2.loadIdentity();
		//rotation2.fromAngleAxis((float)(-Math.PI/2), new Vector3f(0, 1, 0));
		//block2.setRotation(rotation2);

		this.addBlock( block2);

		ODEJoint j = (ODEJoint)block2.getBlock().getJoints().get(0);
		ODEJointPoint jp = (ODEJointPoint)block1.getBlock().getJoints().get(0);
		
		// hack, wired way to get Joint and JointPoint
		j.connect(jp);
		
		//block1.getBlock().
		//Block b = model.create();
		//this.addBlock( b);
		
		// create joints
		//BJoint j = new BJointBall(this._engine.getWorld());
		//j.connect(a, b);	
	}
}
